package com.guoxin.chapter3.waitnotify.pipedinputoutput;

import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;

public class Run {
	public static void main(String[] args) throws IOException, InterruptedException {
		WriteData writeData = new WriteData();
		ReadData readData = new ReadData();
		
		PipedInputStream in = new PipedInputStream();
		PipedOutputStream out = new PipedOutputStream();
		
		in.connect(out);
//		out.connect(in);
		
		ThreadRead read = new ThreadRead(readData, in);
		read.start();
		Thread.sleep(1000);
		ThreadWrite write = new ThreadWrite(writeData, out);
		write.start();
		
	}
}
